package top.glike.ssl.auto.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import top.glike.ssl.common.annotation.Excel;
import top.glike.ssl.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 同步记录对象 ssl_cert_sync_log
 *
 * @author Sophia
 * @date 2025-10-12
 */
public class SslCertSyncLog extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 域名证书ID
     */
    @Excel(name = "域名证书ID")
    private Long domainCertificateId;

    /**
     * 服务器ID
     */
    @Excel(name = "服务器ID")
    private Long serverId;

    /**
     * 同步类型
     */
    @Excel(name = "同步类型")
    private String syncType;

    /**
     * 操作类型
     */
    @Excel(name = "操作类型")
    private String operation;

    /**
     * 证书文件路径
     */
    @Excel(name = "证书文件路径")
    private String certFilePath;

    /**
     * 私钥文件路径
     */
    private String keyFilePath;

    /**
     * 同步状态
     */
    @Excel(name = "同步状态")
    private String syncStatus;

    /**
     * 错误信息
     */
    @Excel(name = "错误信息")
    private String errorMessage;

    /**
     * 文件大小(字节)
     */
    @Excel(name = "文件大小(字节)")
    private Long fileSize;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getDomainCertificateId() {
        return domainCertificateId;
    }

    public void setDomainCertificateId(Long domainCertificateId) {
        this.domainCertificateId = domainCertificateId;
    }

    public Long getServerId() {
        return serverId;
    }

    public void setServerId(Long serverId) {
        this.serverId = serverId;
    }

    public String getSyncType() {
        return syncType;
    }

    public void setSyncType(String syncType) {
        this.syncType = syncType;
    }

    public String getOperation() {
        return operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public String getCertFilePath() {
        return certFilePath;
    }

    public void setCertFilePath(String certFilePath) {
        this.certFilePath = certFilePath;
    }

    public String getKeyFilePath() {
        return keyFilePath;
    }

    public void setKeyFilePath(String keyFilePath) {
        this.keyFilePath = keyFilePath;
    }

    public String getSyncStatus() {
        return syncStatus;
    }

    public void setSyncStatus(String syncStatus) {
        this.syncStatus = syncStatus;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("domainCertificateId", getDomainCertificateId())
                .append("serverId", getServerId())
                .append("syncType", getSyncType())
                .append("operation", getOperation())
                .append("certFilePath", getCertFilePath())
                .append("keyFilePath", getKeyFilePath())
                .append("syncStatus", getSyncStatus())
                .append("errorMessage", getErrorMessage())
                .append("fileSize", getFileSize())
                .append("startTime", getStartTime())
                .append("endTime", getEndTime())
                .append("createdTime", getCreatedTime())
                .toString();
    }
}
